/* 主容器样式 */
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: #f8f9fa;
  overflow: hidden;
}

/* 整体布局容器 */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* 左侧面板 */
.left-panel {
  width: 300px;
  min-width: 250px;
  max-width: 500px;
  background-color: #ffffff;
  border-right: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 文件拖拽区域 */
.drop-zone {
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
  background-color: #f8f9fa;
}

.drop-area {
  border: 2px dashed #6c757d;
  border-radius: 8px;
  padding: 30px 20px;
  text-align: center;
  background-color: #ffffff;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* 蚂蚁线边框动画 */
.drop-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px dashed #007bff;
  border-radius: 8px;
  opacity: 0;
  animation: marching-ants 1s linear infinite;
  transition: opacity 0.3s ease;
}

.drop-area:hover::before,
.drop-area.drag-over::before {
  opacity: 1;
}

@keyframes marching-ants {
  0% {
    border-dash-offset: 0;
  }
  100% {
    border-dash-offset: 20px;
  }
}

.drop-area:hover {
  border-color: #007bff;
  background-color: #f0f8ff;
}

.drop-area.drag-over {
  border-color: #007bff;
  background-color: #e3f2fd;
  transform: scale(1.02);
}

.drop-area p {
  margin: 0 0 15px 0;
  color: #6c757d;
  font-size: 14px;
}

.drop-area .btn {
  background-color: #007bff;
  border-color: #007bff;
  color: white;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.drop-area .btn:hover {
  background-color: #0056b3;
  border-color: #0056b3;
  transform: translateY(-1px);
}

/* 目录结构区域 */
.directory-panel {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background-color: #ffffff;
}

.directory-panel h5 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #495057;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 8px;
}

/* 树形视图样式 */
.tree-view {
  font-size: 14px;
}

.tree-item {
  padding: 6px 8px;
  margin: 2px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.tree-item:hover {
  background-color: #f8f9fa;
}

.tree-item.active {
  background-color: #007bff;
  color: white;
}

.tree-item-content {
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-icon {
  margin-right: 6px;
  font-size: 14px;
}

.file-count {
  margin-left: auto;
  background-color: #6c757d;
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}

.tree-item.active .file-count {
  background-color: rgba(255, 255, 255, 0.3);
}

/* 折叠箭头图标 */
.collapse-icon {
  margin-left: auto;
  width: 0;
  height: 0;
  border-style: solid;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.collapse-icon.expanded {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #6c757d;
  transform: rotate(0deg);
}

.collapse-icon.collapsed {
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid #6c757d;
  transform: rotate(0deg);
}

.collapse-icon:hover {
  border-top-color: #007bff;
  border-left-color: #007bff;
}

/* 分隔条 */
.resizer {
  width: 4px;
  background-color: #e9ecef;
  cursor: col-resize;
  transition: background-color 0.2s ease;
  position: relative;
  z-index: 10;
}

.resizer:hover {
  background-color: #007bff;
}

.resizer.dragging {
  background-color: #007bff;
  box-shadow: 0 0 0 1px #007bff;
}

.resizer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -2px;
  right: -2px;
  bottom: 0;
  background: transparent;
}

/* 右侧内容区域 */
.right-panel {
  flex: 1;
  background-color: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.content-header {
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
  background-color: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.content-header h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #495057;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 30px;
  min-height: 30px;
}

#headerSearchContainer {
  width: 50%;
  min-width: 300px;
}

#logAnalysisBtn {
  white-space: nowrap;
}

.content-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* 日志内容容器占满剩余高度 */
#logContent {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#logContent .card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#logContent .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 概述页面样式 */
.overview-content {
  max-width: 800px;
}

.overview-section {
  margin-bottom: 30px;
}

.overview-section h5 {
  margin: 0 0 15px 0;
  font-size: 18px;
  font-weight: 600;
  color: #495057;
  border-bottom: 2px solid #007bff;
  padding-bottom: 8px;
}

.card {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-body {
  padding: 20px;
}

/* 截图网格 */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.screenshot-item {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.screenshot-item:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.screenshot-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.screenshot-item .caption {
  padding: 8px;
  font-size: 12px;
  color: #6c757d;
  text-align: center;
  background-color: #f8f9fa;
}

/* 隐藏类 */
.d-none {
  display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .left-panel {
    width: 250px;
    min-width: 200px;
  }
  
  .drop-area {
    padding: 20px 15px;
  }
  
  .content-header {
    padding: 15px;
  }
  
  .content-body {
    padding: 15px;
  }
  
  .screenshots-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 加载动画 */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: #6c757d;
}

.loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 概述表格样式 */
.overview-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  border: 1px solid #dee2e6;
}

.overview-table td {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  vertical-align: top;
}

.key-cell {
  font-weight: bold;
  background-color: #f8f9fa;
  width: auto;
  white-space: nowrap;
}

.value-cell {
  background-color: #ffffff;
  word-wrap: break-word;
  word-break: break-all;
}

.description-cell {
  position: relative;
}

.description-value {
  padding-right: 120px; /* 为按钮留出空间 */
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.5;
}

.action-buttons {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 5px;
}

.action-buttons .btn {
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 3px;
}

.description-row td {
  position: relative;
}

.problem-translation {
  display: none;
}

.problem-translation.show {
  display: table-row;
}

#translation-result {
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.5;
  padding: 8px;
}

/* 截图网格样式优化 */
.screenshots-grid {
  display: flex;
  gap: 15px;
  justify-content: space-between;
  align-items: flex-start;
}

.screenshot-item {
  flex: 1;
  max-width: calc(33.333% - 10px);
  text-align: center;
}

.screenshot-item img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  cursor: pointer;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  transition: transform 0.2s ease;
}

.screenshot-item img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.no-data-container {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 40px;
  width: 100%;
}

/* 灯箱样式 */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.close-lightbox {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 30px;
  cursor: pointer;
  background: none;
  border: none;
}

.close-lightbox:hover {
  color: #ccc;
}

.lightbox-caption {
  color: white;
  text-align: center;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .key-cell {
    min-width: 80px;
  }
  
  .description-value {
    padding-right: 100px;
  }
  
  .action-buttons {
    right: 5px;
  }
  
  .action-buttons .btn {
    padding: 1px 6px;
    font-size: 11px;
  }
  
  .screenshots-grid {
    flex-direction: column;
    gap: 10px;
  }
  
  .screenshot-item {
    max-width: 100%;
  }
}

/* Toast 提示样式 */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: none;
}

.toast-message {
  background-color: #28a745;
  color: white;
  padding: 12px 20px;
  border-radius: 4px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
  min-width: 120px;
  text-align: center;
}

.toast-message.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-message.error {
  background-color: #dc3545;
}

/* 日志高亮样式 */
.log-error {
  color: #dc3545;
  font-weight: bold;
}

.log-warning {
  color: #ffc107;
  font-weight: bold;
}

.log-info {
  color: #17a2b8;
}

.log-timestamp {
  color: #6c757d;
  font-family: monospace;
}

.log-level {
  color: #495057;
  font-weight: bold;
}

.log-tag {
  color: #007bff;
  font-weight: bold;
}

.log-event {
  color: #28a745;
}

.log-command {
  color: #fd7e14;
}

.log-receive {
  color: #20c997;
}

.log-send {
  color: #e83e8c;
}

.log-other {
  color: #495057;
}

/* Bootstrap utility classes */
.p-0 {
  padding: 0 !important;
}

.toast-message.warning {
  background-color: #ffc107;
  color: #212529;
}

.toast-message.info {
  background-color: #17a2b8;
}